package com.kun.config;

import com.kun.bean.Person;
import com.kun.filter.MyTypeFilter;
import org.springframework.context.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

/**
 * @author fangkun
 * @create 2022-04-24-16:32
 */
//使用includeFilters()方法来指定只包含哪些注解标注的类时，需要禁用掉默认的过滤规则。
@ComponentScan(value = "com.kun", includeFilters = {
        @ComponentScan.Filter(type = FilterType.CUSTOM, classes = {MyTypeFilter.class})
},useDefaultFilters=false)
@Configuration
public class MainConfig {

    @Bean
    public Person person(){
        return new Person("FangKun",20);
    }
}
